package com.scuec.groupfive.Controller;

import com.scuec.groupfive.service.KnowledgeStatisticsService;
import com.scuec.groupfive.vo.KnowledgeStatisticsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 知识点掌握情况统计Controller
 */
@RestController
@RequestMapping("/api/knowledge-statistics")
public class KnowledgeStatisticsController {

    @Autowired
    private KnowledgeStatisticsService knowledgeStatisticsService;

    @GetMapping("/chapter-stats")
    public List<KnowledgeStatisticsVO> getChapterKnowledgeStatistics(
            @RequestParam("userId") Long userId,
            @RequestParam("subjectId") Integer subjectId,
            @RequestParam("typeId") Integer typeId) {
        return knowledgeStatisticsService.getKnowledgeStatistics(userId, subjectId, typeId);
    }
}